/*
 * StandardSinkParamBO.java 
 * 
 * Copyright 2009 Wangfeng Beijing Inc. 
 * All rights reserved. 
 * 
 * Created on 2012-08-30
 */
 
package com.bjtech.domain.query;

import java.util.Date;
import com.bjtech.web.util.SelectBean;
import org.ssi.web.util.QuerySpecTpl;

/**
 * 功能概述:标准散热器信息 <br>
 * @author 王峰
 */
 
public class StandardSinkParamQuerySpec extends SelectBean {
	/* */
	private Long id;
	/* */
	private String sink_name;
	/* */
	private String sink_brand;
	/* */
	private Float sink_height;
	/* */
	private Float sink_width;
	/* */
	private Float sink_length;
	/* */
	private Float sink_cen_dis;
	/* */
	private Float cal_power;

	@Override
	public void queryParamString() {
		StringBuilder fromPart = new StringBuilder(" where 1=1");
		
		if(this.isAll !=null && this.isAll.intValue()!=1){
		if (QuerySpecTpl.isValid(id)) {
						fromPart.append(" and a.id = ");
			fromPart.append(id);
					}
				
		if (QuerySpecTpl.isValid(sink_name)) {
						fromPart.append(" and a.sink_name like ");
			fromPart.append(" CONCAT('%','");
			fromPart.append(sink_name);
			fromPart.append("','%')");
					}
				
		if (QuerySpecTpl.isValid(sink_brand)) {
						fromPart.append(" and a.sink_brand like ");
			fromPart.append(" CONCAT('%','");
			fromPart.append(sink_brand);
			fromPart.append("','%')");
					}
				
		if (QuerySpecTpl.isValid(sink_height)) {
						fromPart.append(" and a.sink_height = ");
			fromPart.append(sink_height);
					}
				
		if (QuerySpecTpl.isValid(sink_width)) {
						fromPart.append(" and a.sink_width = ");
			fromPart.append(sink_width);
					}
				
		if (QuerySpecTpl.isValid(sink_length)) {
						fromPart.append(" and a.sink_length = ");
			fromPart.append(sink_length);
					}
				
		if (QuerySpecTpl.isValid(sink_cen_dis)) {
						fromPart.append(" and a.sink_cen_dis = ");
			fromPart.append(sink_cen_dis);
					}
				
		if (QuerySpecTpl.isValid(cal_power)) {
						fromPart.append(" and a.cal_power = ");
			fromPart.append(cal_power);
					}
				

		if (QuerySpecTpl.isValid(this.direction)
				&& QuerySpecTpl.isValid(this.sort)) {
			fromPart.append(" order by ");
			fromPart.append(this.sort);
			fromPart.append(" ");
			fromPart.append(this.direction);
		} else {
			fromPart.append(" order by ");
			fromPart.append("id");
			fromPart.append(" ");
			fromPart.append("desc");

		}
		}
		super.setQueryString(fromPart.toString());
	}

	public Long getId(){
		return this.id;
	}
	public void setId(Long id){
		this.id = id;
	}
	public String getSink_name(){
		return this.sink_name;
	}
	public void setSink_name(String sink_name){
		this.sink_name = sink_name;
	}
	public String getSink_brand(){
		return this.sink_brand;
	}
	public void setSink_brand(String sink_brand){
		this.sink_brand = sink_brand;
	}
	public Float getSink_height(){
		return this.sink_height;
	}
	public void setSink_height(Float sink_height){
		this.sink_height = sink_height;
	}
	public Float getSink_width(){
		return this.sink_width;
	}
	public void setSink_width(Float sink_width){
		this.sink_width = sink_width;
	}
	public Float getSink_length(){
		return this.sink_length;
	}
	public void setSink_length(Float sink_length){
		this.sink_length = sink_length;
	}
	public Float getSink_cen_dis(){
		return this.sink_cen_dis;
	}
	public void setSink_cen_dis(Float sink_cen_dis){
		this.sink_cen_dis = sink_cen_dis;
	}
	public Float getCal_power(){
		return this.cal_power;
	}
	public void setCal_power(Float cal_power){
		this.cal_power = cal_power;
	}
}
